/*package com.szrt.oa.menu.dao.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.szrt.oa.base.DBUtil;
import com.szrt.oa.menu.dao.MenuDao;
import com.szrt.oa.menu.entity.MenuEntity;

public class MenuDaoImpl implements MenuDao{
	
	Connection conn;

	@Override
	public List<MenuEntity> findMenuByUserId(int id,Connection conn) throws Exception {
		conn = DBUtil.getConn();
		String sql="SELECT m.ID as id,m.MENU_NAME AS menuName, m.URL as url FROM oa_user_t AS u LEFT JOIN oa_user_role_rs AS ur ON u.ID=ur.USER_ID LEFT JOIN oa_role_menu_rs as rm on rm.ROLE_ID=ur.ROLE_ID LEFT JOIN oa_menu_t AS m on m.ID=rm.MENU_ID WHERE u.ID=?;";
		PreparedStatement ps = conn.prepareStatement(sql);
		ps.setInt(1,id);
		ResultSet rs = ps.executeQuery();
		List<MenuEntity> list=new ArrayList<MenuEntity>();
		MenuEntity entity=new MenuEntity();
		while(rs.next()){
			
			entity.setId(rs.getInt("id"));
			entity.setMenu_name(rs.getString("menuName"));
			entity.setUrl(rs.getString("url"));
			
			list.add(entity);
		}
		return list;
	}

}
*/